<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="/dist/css/bootstrap.css">
</head>

<body>

    <div class="container">
        <div class="page-header">
            <h1 class="text-center">信息管理系统</h1>
        </div>
        <h2 class="clearfix">
            数据列表
            <a class="btn btn-success pull-right" href="/add">添加</a>
        </h2>
        <table class="table">
            <thead>
                <tr>
                    <th>#</th>
                    <th>名称(name)</th>
                    <th>年龄(age)</th>
                    <th>邮箱(email)</th>
                    <th>操作(operate)</th>
                </tr>
            </thead>
            <tbody>
                <% datalists.forEach(function(item,index){ %>
                    <tr>
                        <th scope="row">
                            <%=index+1%>
                        </th>
                        <td>
                            <%=item.name%>
                        </td>
                        <td>
                            <%=item.age%>
                        </td>
                        <td>
                            <%=item.info%>
                        </td>
                        <td>
                            <a class="btn btn-info" href="/edit?id=<%=item.id%>">修改</a>
                            <a class="btn btn-danger" href="/del?id=<%=item.id%>">删除</a>
                        </td>
                    </tr>
                    <% }) %>
            </tbody>
        </table>

        <a href="/clear">
            <button type="submit" class="btn btn-default">退出登录</button>
        </a>
    </div>

</body>

</html>